<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const router = useRouter()

onMounted(() => {
  ElMessage.error('用户未授权或授权已过期，请重新登录')
})

// 使用图标组件
const ArrowRight = ElementPlusIconsVue.ArrowRight

// 跳转到氚云系统
const goToH3Yun = () => {
  window.location.href = 'https://www.h3yun.com/entry/'
}
</script>

<template>
  <div class="login-container">
    <div class="login-box">
      <h2>系统访问提示</h2>
      
      <div class="login-message">
        <el-alert
          title="用户未授权或授权已过期"
          type="info"
          description="您需要通过钉钉或氚云授权后才能访问本系统"
          show-icon
          :closable="false"
          class="login-alert"
        />
        
        <div class="login-image">
          <img src="" alt="氚云系统" class="tianyun-logo" />
        </div>
        
        <el-button type="primary" @click="goToH3Yun" class="login-btn">
          前往氚云系统
          <el-icon class="el-icon--right"><ArrowRight /></el-icon>
        </el-button>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.login-container {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  width: 400px;
  padding: 40px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.login-box h2 {
  text-align: center;
  color: #303133;
  margin-bottom: 30px;
}

.login-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.login-alert {
  width: 100%;
}

.login-image {
  text-align: center;
  margin: 10px 0;
  width: 94px;
  height: 40px;
  position: relative;
  img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }
}

.tianyun-logo {
  max-width: 94px;
  max-height: 40px;
  width: auto;
  height: auto;
}

.login-btn {
  width: 100%;
}
</style> 